public class ques5 {
	public static void main(String args[]) {
		long i = 8L,add=0L,MAX=8888888888L;
		for (;i<=MAX;i=i*10+8){
			add += i;
		}
		System.out.println(add);
	}
}
